import React, {Component} from 'react';

class NativeEventDemo extends Component {

  componentDidMount () {
    this.refs.button.addEventListener('click', (e) => {
      this.handleClick(e);
    }, false);
  }
  handleClick (e) {
    console.log(e)
  }
  componentWillUnmount () {
    this.refs.removeEventListenter('click');
  }
  render () {
    return (
      <div>
        <span>测试</span>
        <button ref="button">原生事件</button>
      </div>
    )
  }
}

export default NativeEventDemo;
